#include<gtk/gtk.h>
#include<gdk/gdk.h>
#include <math.h>
#include <time.h>
#include <stdlib.h>

static GdkPixmap *pixmap = NULL;
int radius;


gint expose_event (GtkWidget *widget, GdkEventExpose *event)
{
    gdk_draw_pixmap (widget->window,
          widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
          pixmap,
          event->area.x, event->area.y,
          event->area.x, event->area.y,
          event->area.width, event->area.height);
    return FALSE;
}

int main (int argc, char *argv[])
{
    GtkWidget *window;
    GtkWidget *drawing_area;
    GtkWidget *vbox;
    gtk_init (&argc, &argv);
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);  

    vbox = gtk_hbox_new (FALSE, 0);
    gtk_container_add (GTK_CONTAINER (window), vbox);
    gtk_widget_show (vbox);

    gtk_signal_connect (GTK_OBJECT (window), "destroy",
                G_CALLBACK(gtk_main_quit), NULL);
   
   
    drawing_area = gtk_drawing_area_new ();
    gtk_drawing_area_size (GTK_DRAWING_AREA (drawing_area), 200, 200);
    gtk_box_pack_start (GTK_BOX (vbox), drawing_area, TRUE, TRUE, 0);
    gtk_widget_show (drawing_area);
   
    gtk_signal_connect (GTK_OBJECT (drawing_area), "expose_event",
                (GtkSignalFunc) expose_event, NULL);

    gtk_widget_show (window);
    pixmap = gdk_pixmap_new (drawing_area->window,
              drawing_area->allocation.width,
              drawing_area->allocation.height,
              -1);

    gdk_draw_point(pixmap, drawing_area->style->white_gc,190,190);
    gdk_draw_point(pixmap, drawing_area->style->white_gc,190,189);
    gdk_draw_point(pixmap, drawing_area->style->white_gc,190,191);
    gdk_draw_arc(pixmap, drawing_area->style->white_gc,FALSE,0,0,50,50,0,360*64);
    gdk_draw_line (pixmap, drawing_area->style->white_gc,30,30,130,130);
   
   
    gtk_widget_queue_draw(window);
   
    gtk_main ();
    return 0;
}